import VueRouter from 'vue-router'
import Layout from '@/layout'

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "user" */ '../views/login/login.vue'),
    meta: {
      name: '登陆',
      index: 1,
    },
  },
  {
    path: '/',
    component: Layout,
    redirect: '/theme/index',
  },
  {
    path: '/theme',
    component: Layout,
    redirect: '/theme/index',
    children: [
      {
        path: 'index',
        name: 'moduleOne',
        component: resolve => require(['@/views/theme/index'], resolve),
        meta: { name: '模块1', index: 2 },
      },
    ],
  },
]

const router = new VueRouter({
  mode: 'hash',
  routes,
})

export default router
